<?php

$userid = get_loggedin_userid();

$interests = greengar_opinions_get_user_interests(NULL, $userid, NULL);

$array_interests = array();
$return_interests = array();

foreach ($interests as $interest) {
    $array_interests[] = $interest->toArrayInterestObject();
}


foreach ($array_interests as $array_interest) {
	if($array_interest['owner_guid'] == $userid) {
		$return_interests[] = $array_interest;
	}
}

echo json_encode(export_result(200, $return_interests));  

?>